package hcn.protocol.brandnew.zhenliao.jianyan;

import lombok.Data;
import javax.xml.bind.annotation.*;
import java.util.List;
import hcn.protocol.brandnew.BaseRequest;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import ctd.util.xml.jaxb.DateTimeAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.atag.sysrouter.annotation.DictionaryMapping;

/**
 * 检验报告列表和明细查询(批量)-响应消息(成功) - ODS_03050203_SUC
 *
 * @author enjoyLife
 */
@Data
@XmlRootElement(name = "Data")
@XmlAccessorType(XmlAccessType.FIELD)
public class LabReportBatchQueryResponse {

    /**
     * 总记录数
     */
    @XmlElement(name = "Total")
    private Long total;
    /**
     * 检验报告集合
     */
    @XmlElementWrapper(name = "InspectionTestRecords")
    @XmlElement(name = "InspectionTestRecord")
    private List<InspectionTestRecord> inspectionTestRecords;

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class TestResult {

        /**
         * 检验项目代码
         */
        @XmlElement(name = "TestId")
        private String testId;
        /**
         * 检验项目名称
         */
        @XmlElement(name = "TestName")
        private String testName;
        /**
         * 检验定量结果
         */
        @XmlElement(name = "TestResult")
        private Long testResult;
        /**
         * 检验定性结果
         */
        @XmlElement(name = "ResultQualitative")
        private String resultQualitative;
        /**
         * 检验定量结果计量单位
         */
        @XmlElement(name = "ResultUnit")
        private String resultUnit;
        /**
         * 检验结果代码
         */
        @XmlElement(name = "ResultCode")
        private String resultCode;
        /**
         * 参考值范围
         */
        @XmlElement(name = "ReferenceRange")
        private String referenceRange;
        /**
         * 参考值下限
         */
        @XmlElement(name = "ReferenceLow")
        private String referenceLow;
        /**
         * 参考值上限
         */
        @XmlElement(name = "ReferenceHigh")
        private String referenceHigh;
        /**
         * 检验结果提示
         */
        @XmlElement(name = "ResultHint")
        private String resultHint;
        /**
         * 仪器编号
         */
        @XmlElement(name = "InstrumentCode")
        private String instrumentCode;
        /**
         * 仪器名称
         */
        @XmlElement(name = "InstrumentName")
        private String instrumentName;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class PlantResult {

        /**
         * 检验项目代码
         */
        @XmlElement(name = "PlantTestId")
        private String plantTestId;
        /**
         * 检验项目名称
         */
        @XmlElement(name = "PlantTestName")
        private String plantTestName;
        /**
         * 细菌培养类型
         */
        @XmlElement(name = "PlantType")
        private Byte plantType;
        /**
         * 培养结果
         */
        @XmlElement(name = "PlantResult")
        private String plantResult;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class AntiResult {

        /**
         * 细菌代码
         */
        @XmlElement(name = "BioId")
        private String bioId;
        /**
         * 药敏项目代码
         */
        @XmlElement(name = "AntiId")
        private String antiId;
        /**
         * 药敏项目名称
         */
        @XmlElement(name = "AntiName")
        private String antiName;
        /**
         * KB结果
         */
        @XmlElement(name = "KBResult")
        private String kBResult;
        /**
         * MIC结果
         */
        @XmlElement(name = "MICResult")
        private String mICResult;
        /**
         * ETEST结果
         */
        @XmlElement(name = "ETESTResult")
        private String eTESTResult;
        /**
         * 耐药性结果
         */
        @XmlElement(name = "AntiResult")
        private String antiResult;
        /**
         * 药敏检测方法
         */
        @XmlElement(name = "AntiEaxmMethod")
        private Byte antiEaxmMethod;
        /**
         * 药敏结果单位
         */
        @XmlElement(name = "AntiResultUnit")
        private String antiResultUnit;
        /**
         * 打印次序
         */
        @XmlElement(name = "PrintOrder")
        private Short printOrder;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class BioResult {

        /**
         * 细菌代码
         */
        @XmlElement(name = "BioId")
        private String bioId;
        /**
         * 细菌名称
         */
        @XmlElement(name = "BioName")
        private String bioName;
        /**
         * 微生物类型
         */
        @XmlElement(name = "BioType")
        private Byte bioType;
        /**
         * 细菌数量
         */
        @XmlElement(name = "BioQuantity")
        private String bioQuantity;
        /**
         * 细菌数量单位
         */
        @XmlElement(name = "BioUnit")
        private String bioUnit;
        /**
         * 细菌顺序号
         */
        @XmlElement(name = "BioNO")
        private Byte bioNO;
        /**
         * 细菌备注信息
         */
        @XmlElement(name = "BioRemarks")
        private String bioRemarks;
        /**
         * 药敏结果集合
         */
        @XmlElementWrapper(name = "AntiResults")
        @XmlElement(name = "AntiResult")
        private List<AntiResult> antiResults;
    }

    @Data
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class InspectionTestRecord {

        /**
         * 就诊机构代码
         */
        @XmlElement(name = "VisitOrganization")
        private String visitOrganization;
        /**
         * 就诊机构名称
         */
        @XmlElement(name = "VisitOrganizationName")
        private String visitOrganizationName;
        /**
         * 患者类型代码
         */
        @XmlElement(name = "PatientType")
        @DictionaryMapping("CV09_00_404")
        private String patientType;
        /**
         * 患者姓名
         */
        @XmlElement(name = "Name")
        private String name;
        /**
         * 性别代码
         */
        @XmlElement(name = "Sex")
        private String sex;
        /**
         * 年龄
         */
        @XmlElement(name = "AgeValue")
        private Short ageValue;
        /**
         * 年龄单位
         */
        @XmlElement(name = "AgeUnit")
        private String ageUnit;
        /**
         * 检验标本号
         */
        @XmlElement(name = "SampleNo")
        private String sampleNo;
        /**
         * 检验报告单编号
         */
        @XmlElement(name = "ReportId")
        private String reportId;
        /**
         * 检验项目名称
         */
        @XmlElement(name = "LabOrderItemName")
        private String labOrderItemName;
        /**
         * 检验报告结果状态
         */
        @XmlElement(name = "ReportResultStatus")
        private Byte reportResultStatus;
        /**
         * 标本检验日期
         */
        @XmlElement(name = "SampleTestTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date sampleTestTime;
        /**
         * 检验报告日期
         */
        @XmlElement(name = "ReportTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date reportTime;
        /**
         * 检验申请科室
         */
        @XmlElement(name = "RequestDept")
        private String requestDept;
        /**
         * 申请科室名称
         */
        @XmlElement(name = "RequestDeptName")
        private String requestDeptName;
        /**
         * 检验申请医师代码
         */
        @XmlElement(name = "RequestDoctorCode")
        private String requestDoctorCode;
        /**
         * 检验申请医师姓名
         */
        @XmlElement(name = "RequestDoctorName")
        private String requestDoctorName;
        /**
         * 检验报告科室
         */
        @XmlElement(name = "ReportDept")
        private String reportDept;
        /**
         * 报告审核时间
         */
        @XmlElement(name = "ReportCheckTime")
        @XmlJavaTypeAdapter(DateTimeAdapter.class)
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date reportCheckTime;
        /**
         * 审核医师签名
         */
        @XmlElement(name = "ReportChecker")
        private String reportChecker;
        /**
         * 报告医师签名
         */
        @XmlElement(name = "ReportDoctor")
        private String reportDoctor;
        /**
         * 标本类别名称
         */
        @XmlElement(name = "SampleTypeName")
        private String sampleTypeName;
        /**
         * 标本状态
         */
        @XmlElement(name = "SampleState")
        private String sampleState;
        /**
         * 检验报告审核意见
         */
        @XmlElement(name = "ReportCheckOpinion")
        private String reportCheckOpinion;
        /**
         * 常规报告集合
         */
        @XmlElementWrapper(name = "TestResults")
        @XmlElement(name = "TestResult")
        private List<TestResult> testResults;
        /**
         * 培养结果集合
         */
        @XmlElementWrapper(name = "PlantResults")
        @XmlElement(name = "PlantResult")
        private List<PlantResult> plantResults;
        /**
         * 细菌结果集合
         */
        @XmlElementWrapper(name = "BioResults")
        @XmlElement(name = "BioResult")
        private List<BioResult> bioResults;

        @XmlElement(name = "SourcePatientId")
        private String sourcePatientId;
        @XmlElement(name = "IdCard")
        private String idCard;
        @XmlElement(name = "VisitId")
        private String visitId;
    }

}
